home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / AIFF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  4.0 KB  |  228 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        AIFF.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __AIFF__
  13. #define __AIFF__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19.  
  20. enum {
  21.  
  22.  
  23. #define AIFFID 'AIFF'
  24. #define AIFCID 'AIFC'
  25. #define FormatVersionID 'FVER'
  26. #define CommonID 'COMM'
  27. #define FORMID 'FORM'
  28. #define SoundDataID 'SSND'
  29. #define MarkerID 'MARK'
  30. #define InstrumentID 'INST'
  31. #define MIDIDataID 'MIDI'
  32. #define AudioRecordingID 'AESD'
  33. #define ApplicationSpecificID 'APPL'
  34. #define CommentID 'COMT'
  35. #define NameID 'NAME'
  36. #define AuthorID 'AUTH'
  37. #define CopyrightID '(c) '
  38. #define AnnotationID 'ANNO'
  39.  
  40.  NoLooping = 0,
  41.  ForwardLooping = 1,
  42.  ForwardBackwardLooping = 2,
  43.  
  44. /* AIFF-C Versions */
  45.  AIFCVersion1 = 0xA2805140
  46.  
  47. /* Compression Names */
  48.  
  49. #define NoneName "\pnot compressed"
  50. #define ACE2to1Name "\pACE 2-to-1"
  51. #define ACE8to3Name "\pACE 8-to-3"
  52. #define MACE3to1Name "\pMACE 3-to-1"
  53. #define MACE6to1Name "\pMACE 6-to-1"
  54.  
  55. /* Compression Types */
  56. #define NoneType 'NONE'
  57. #define ACE2Type 'ACE2'
  58. #define ACE8Type 'ACE8'
  59. #define MACE3Type 'MAC3'
  60. #define MACE6Type 'MAC6'
  61. };
  62.  
  63. typedef unsigned long ID;
  64. typedef short MarkerIdType;
  65.  
  66. struct ChunkHeader {
  67.  ID ckID;
  68.  long ckSize;
  69. };
  70.  
  71. typedef struct ChunkHeader ChunkHeader;
  72.  
  73. struct ContainerChunk {
  74.  ID ckID;
  75.  long ckSize;
  76.  ID formType;
  77. };
  78.  
  79. typedef struct ContainerChunk ContainerChunk;
  80.  
  81. struct FormatVersionChunk {
  82.  ID ckID;
  83.  long ckSize;
  84.  unsigned long timestamp;
  85. };
  86.  
  87. typedef struct FormatVersionChunk FormatVersionChunk;
  88. typedef FormatVersionChunk *FormatVersionChunkPtr;
  89.  
  90. struct CommonChunk {
  91.  ID ckID;
  92.  long ckSize;
  93.  short numChannels;
  94.  unsigned long numSampleFrames;
  95.  short sampleSize;
  96.  extended80 sampleRate;
  97. };
  98.  
  99. typedef struct CommonChunk CommonChunk;
  100. typedef CommonChunk *CommonChunkPtr;
  101.  
  102. struct ExtCommonChunk {
  103.  ID ckID;
  104.  long ckSize;
  105.  short numChannels;
  106.  unsigned long numSampleFrames;
  107.  short sampleSize;
  108.  extended80 sampleRate;
  109.  ID compressionType;
  110.  char compressionName[1];
  111. };
  112.  
  113. typedef struct ExtCommonChunk ExtCommonChunk;
  114. typedef ExtCommonChunk *ExtCommonChunkPtr;
  115.  
  116. struct SoundDataChunk {
  117.  ID ckID;
  118.  long ckSize;
  119.  unsigned long offset;
  120.  unsigned long blockSize;
  121. };
  122.  
  123. typedef struct SoundDataChunk SoundDataChunk;
  124. typedef SoundDataChunk *SoundDataChunkPtr;
  125.  
  126. struct Marker {
  127.  MarkerIdType id;
  128.  unsigned long position;
  129.  Str255 markerName;
  130. };
  131.  
  132. typedef struct Marker Marker;
  133.  
  134. struct MarkerChunk {
  135.  ID ckID;
  136.  long ckSize;
  137.  unsigned short numMarkers;
  138.  Marker Markers[1];
  139. };
  140.  
  141. typedef struct MarkerChunk MarkerChunk;
  142. typedef MarkerChunk *MarkerChunkPtr;
  143.  
  144. struct AIFFLoop {
  145.  short playMode;
  146.  MarkerIdType beginLoop;
  147.  MarkerIdType endLoop;
  148. };
  149.  
  150. typedef struct AIFFLoop AIFFLoop;
  151.  
  152. struct InstrumentChunk {
  153.  ID ckID;
  154.  long ckSize;
  155.  char baseFrequency;
  156.  char detune;
  157.  char lowFrequency;
  158.  char highFrequency;
  159.  char lowVelocity;
  160.  char highVelocity;
  161.  short gain;
  162.  AIFFLoop sustainLoop;
  163.  AIFFLoop releaseLoop;
  164. };
  165.  
  166. typedef struct InstrumentChunk InstrumentChunk;
  167. typedef InstrumentChunk *InstrumentChunkPtr;
  168.  
  169. struct MIDIDataChunk {
  170.  ID ckID;
  171.  long ckSize;
  172.  unsigned char MIDIdata[1];
  173. };
  174.  
  175. typedef struct MIDIDataChunk MIDIDataChunk;
  176. typedef MIDIDataChunk *MIDIDataChunkPtr;
  177.  
  178. struct AudioRecordingChunk {
  179.  ID ckID;
  180.  long ckSize;
  181.  unsigned char AESChannelStatus[24];
  182. };
  183.  
  184. typedef struct AudioRecordingChunk AudioRecordingChunk;
  185. typedef AudioRecordingChunk *AudioRecordingChunkPtr;
  186.  
  187. struct ApplicationSpecificChunk {
  188.  ID ckID;
  189.  long ckSize;
  190.  OSType applicationSignature;
  191.  char data[1];
  192. };
  193.  
  194. typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
  195. typedef ApplicationSpecificChunk *ApplicationSpecificChunkPtr;
  196.  
  197. struct Comment {
  198.  unsigned long timeStamp;
  199.  MarkerIdType marker;
  200.  unsigned short count;
  201.  char text[1];
  202. };
  203.  
  204. typedef struct Comment Comment;
  205.  
  206. struct CommentsChunk {
  207.  ID ckID;
  208.  long ckSize;
  209.  unsigned short numComments;
  210.  Comment comments[1];
  211. };
  212.  
  213. typedef struct CommentsChunk CommentsChunk;
  214. typedef CommentsChunk *CommentsChunkPtr;
  215.  
  216. struct TextChunk {
  217.  ID ckID;
  218.  long ckSize;
  219.  char text[1];
  220. };
  221.  
  222. typedef struct TextChunk TextChunk;
  223. typedef TextChunk *TextChunkPtr;
  224.  
  225.  
  226.  
  227. #endif
  228.